package o;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.d;
import java.lang.ref.WeakReference;

@RestrictTo({d.LIBRARY_GROUP})
public class dd extends Resources {
    private static boolean ˏ = false;
    private final WeakReference<Context> ˋ;

    public static boolean ˋ() {
        return ˎ() && VERSION.SDK_INT <= 20;
    }

    public dd(@NonNull Context context, @NonNull Resources resources) {
        super(resources.getAssets(), resources.getDisplayMetrics(), resources.getConfiguration());
        this.ˋ = new WeakReference(context);
    }

    public Drawable getDrawable(int i) throws NotFoundException {
        Context context = (Context) this.ˋ.get();
        if (context != null) {
            return bx.ˋ().ˏ(context, this, i);
        }
        return super.getDrawable(i);
    }

    final Drawable ˏ(int i) {
        return super.getDrawable(i);
    }

    public static boolean ˎ() {
        return ˏ;
    }
}
